﻿using VisualWip.Core;
using VisualWip.Core.Columns;
using VisualWip.Core.Interfaces;

namespace VisualWip.TFS2010Providers
{
    public class TfsWorkDoingSettingsViewModel :
        TfsWorkDualQuerySettingsViewModelBase<WorkDoingColumn>
    {
        public TfsWorkDoingSettingsViewModel(Application application, WorkDoingColumn column, IWorkItemSizeProvider workItemSizeProvider,
                                                    IColumnTypeProvider columnTypeProvider)
            : base(application, column,workItemSizeProvider,columnTypeProvider)
        {
        }

        public override string SettingsWindowName
        {
            get { return "Doing column"; }
        }

        protected override void DownloadDisplayFieldsOnlyHasChanged()
        {
            var query = Column.Query as WorkItemQueryBase;
            var secondQuery = Column.SecondQuery as WorkItemQueryBase;

            if (query != null)
                query.DownloadDisplayFieldsOnly = DownloadDisplayFieldsOnly;
            if (secondQuery != null)
                secondQuery.DownloadDisplayFieldsOnly = DownloadDisplayFieldsOnly;
        }

    }
}